﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Services;
using System.Web.Services;

using BOL;
using BOL.CentroCosto;
using DAL;
using UtilityExtensions;


namespace UILGestion.ObraAdmin.RecepcionDoc
{
    public partial class RendicionDocInsertForm : System.Web.UI.Page
    {
        [WebMethod]
        public static List<string> GetAutoCompleteData(string username)
            {
            List<string> result = new List<string>();
            
            return result;
           
        }  
      


        [WebMethod(), ScriptMethod()]
        public static string GetCuentaConf(String prefixText)
        {
            CuentaConfBL bol = new CuentaConfBL();
            var w = bol.GetCuentaConfSearch(prefixText,6, 20);
            var result = Util.Tbl2Str(Util.EntidadToDataTable(w.ToList()));
            return result;
            
        }

        [WebMethod(), ScriptMethod()]
        public static string GetAnexo(String prefixText, String contextKey)
        {
            //contextKey valor Chkval
            var d = contextKey.Split('|');

            CuentaConfBL bol = new CuentaConfBL();
            string a = "O";
            var w = bol.GetAnexoSearch(prefixText, d[0].ToInt(),d[1], 20);
            var result = Util.Tbl2Str(Util.EntidadToDataTable(w.ToList()));
            return result;

        }

        [WebMethod(), ScriptMethod()]
        public static string GetCentroCosto(String prefixText, String contextKey)
        {
            CentroCostoBL bol = new CentroCostoBL();
            var w = bol.GetCentroCostoSearch(prefixText, 6,  20);
            var result = Util.Tbl2Str(Util.EntidadToDataTable(w.ToList()));
            return result;

        }

        

        protected void Page_Load(object sender, EventArgs e)
        {
            try 
	                {	        
		                if (!this.IsPostBack)
                        {
                           // formatForm();
                        }
	                }
	                catch (Exception)
	                {
		
		                throw;
	                }

            
        }


        //private void formatForm()
        //{
        //    cuenta1
        //}

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

       

       
    }
}